# -*- coding:utf-8 -*-
# @Time      :2022/11/5 22:25
# @Author    :To me
# @Email     :2086351502@qq.com
# @File      :urls.py
# @File      :PyCharm

from django.urls import path
from rest_framework.routers import DefaultRouter
from news.views import *


urlpatterns = [
    path('get_news/all_one_news/', GetNewsDocxView.as_view({'get': 'all_one_news'})),  # 01
    path('get_news/all_today_news/', GetNewsDocxView.as_view({'get': 'all_today_news'})),  # 02
    path('get_news/post_docx/', GetNewsDocxView.as_view({'post': 'post_docx'})),  # 03
]
router = DefaultRouter()
router.register('news', NewsView)  # 04
urlpatterns += router.urls

"""
01  http://127.0.0.1:8000/news/get_news/all_one_news/  
02  http://127.0.0.1:8000/news/get_news/all_today_news/
03  http://127.0.0.1:8000/news/get_news/post_docx/
04  http://127.0.0.1:8000/news/news/
01，02 建议后台管理员自己操作 是爬取新闻的操作 第一页和今日的新闻
03 是返回docx文件
04 是返回新闻标题与其发布时间
"""